package com.FundamentalDemos.TypeConversion;

public class TypeConversion1 {
    public static void main(String[] args) {
        //理解自动类型转换机制
        //小范围类型变量可以直接赋值给大范围类型变量,直接复制到低位,高位补符号位,正0负1
        byte a = 12;
        int b = a;//发生了自动类型转换
        System.out.println(a);//12
        System.out.println(b);//12
        //遵循:
        //byte->short->int->long->float->double
        //              ↑
        //             char

        int c = 100;
        double d = c;
        System.out.println(d);

        char ch = 'a';
        int i = ch;
        System.out.println(i);


    }
}
